<?php
	require_once("../../../include/connect.php");
	$nam = $_POST['nam'];
	$query = mysql_query(" SELECT id,name FROM subject WHERE name != '' AND id NOT IN 
							( SELECT subject FROM schedule WHERE year = {$nam} AND subject != '' ) ");
	if(mysql_num_rows($query) > 0)
	{
		while($row = mysql_fetch_array($query))
		{
			echo "<option value='".$row['id']."'> ".$row['name']." </option>";	
		}	
	}
?>